core: Take --repo as the first argument
authorColin Walters <walters@verbum.org>
Fri, 4 Nov 2011 03:08:28 +0000 (23:08 -0400)
committerColin Walters <walters@verbum.org>
Fri, 4 Nov 2011 03:08:28 +0000 (23:08 -0400)
I kept doing this over and over...it feels more natural.  The "prefix"
thing was (almost) unused anyways, and it was easy enough to replace.

21 files changed:
ostree/main.c
ostree/ot-builtin-checkout.c
ostree/ot-builtin-commit.c
ostree/ot-builtin-compose.c
ostree/ot-builtin-fsck.c
ostree/ot-builtin-init.c
ostree/ot-builtin-link-file.c
ostree/ot-builtin-log.c
ostree/ot-builtin-pull.c
ostree/ot-builtin-remote.c
ostree/ot-builtin-rev-parse.c
ostree/ot-builtin-run-triggers.c
ostree/ot-builtin-show.c
ostree/ot-builtins.h
tests/libtest.sh
tests/t0000-basic.sh
tests/t0001-archive.sh
tests/t0002-log.sh
tests/t0003-remote-add.sh
tests/t0004-pull.sh
tests/t0005-compose.sh

index 3359227aec7b44b2c651eff9c8d17e7966402121..e3a205feff44f37777e7dda2e88a72d9e232afb1 100644 (file)
@@ -55,7 +55,7 @@ usage (char **argv, gboolean is_error)
   else
     print_func = g_print;
 
-  print_func ("usage: %s COMMAND [options]\n",
+  print_func ("usage: %s --repo=PATH COMMAND [options]\n",
               argv[0]);
   print_func ("Builtin commands:\n");
 
@@ -74,6 +74,7 @@ main (int    argc,
 {
   OstreeBuiltin *builtin;
   const char *cmd;
+  const char *repo;
 
   g_type_init ();
 
@@ -81,10 +82,14 @@ main (int    argc,
 
   builtin = builtins;
 
-  if (argc < 2)
+  if (argc < 3)
     return usage (argv, 1);
   
-  cmd = argv[1];
+  if (!g_str_has_prefix (argv[1], "--repo="))
+    return usage (argv, 1);
+  repo = argv[1] + strlen ("--repo=");
+
+  cmd = argv[2];
 
   while (builtin->name)
     {
@@ -95,13 +100,13 @@ main (int    argc,
           int tmp_argc;
           char **tmp_argv;
 
-          tmp_argc = argc - 1;
+          tmp_argc = argc - 2;
           tmp_argv = g_new0 (char *, tmp_argc + 1);
 
           tmp_argv[0] = (char*)builtin->name;
           for (i = 0; i < tmp_argc; i++)
-            tmp_argv[i+1] = argv[i+2];
-          if (!builtin->fn (tmp_argc, tmp_argv, NULL, &error))
+            tmp_argv[i+1] = argv[i+3];
+          if (!builtin->fn (tmp_argc, tmp_argv, repo, &error))
             {
               g_free (tmp_argv);
               g_printerr ("%s\n", error->message);
index 573425737f56ba3cd516f741cb19bb34f98c7977..ae17143b655b76b7bab9b3d44c7a187999cad5a7 100644 (file)
 
 #include <glib/gi18n.h>
 
-static char *repo_path;
-
 static GOptionEntry options[] = {
-  { "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
   { NULL }
 };
 
 gboolean
-ostree_builtin_checkout (int argc, char **argv, const char *prefix, GError **error)
+ostree_builtin_checkout (int argc, char **argv, const char *repo_path, GError **error)
 {
   GOptionContext *context;
   gboolean ret = FALSE;
@@ -51,9 +48,6 @@ ostree_builtin_checkout (int argc, char **argv, const char *prefix, GError **err
   if (!g_option_context_parse (context, &argc, &argv, error))
     goto out;
 
-  if (repo_path == NULL)
-    repo_path = ".";
-
   repo = ostree_repo_new (repo_path);
   if (!ostree_repo_check (repo, error))
     goto out;
index 19af39b7351023e0817505828d145eca00c4a34d..d6ccec49af815e16fab431fbc92793c0cc11e82b 100644 (file)
@@ -26,7 +26,6 @@
 
 #include <glib/gi18n.h>
 
-static char *repo_path;
 static gboolean separator_null;
 static int from_fd = -1;
 static gboolean from_stdin;
@@ -39,7 +38,6 @@ static char **additions;
 static char **removals;
 
 static GOptionEntry options[] = {
-  { "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
   { "subject", 's', 0, G_OPTION_ARG_STRING, &subject, "One line subject", "subject" },
   { "body", 'm', 0, G_OPTION_ARG_STRING, &body, "Full description", "body" },
   { "branch", 'b', 0, G_OPTION_ARG_STRING, &branch, "Branch", "branch" },
@@ -54,11 +52,12 @@ static GOptionEntry options[] = {
 };
 
 gboolean
-ostree_builtin_commit (int argc, char **argv, const char *prefix, GError **error)
+ostree_builtin_commit (int argc, char **argv, const char *repo_path, GError **error)
 {
   GOptionContext *context;
   gboolean ret = FALSE;
   OstreeRepo *repo = NULL;
+  char *cwd;
   gboolean using_filename_cmdline;
   gboolean using_filedescriptors;
   GPtrArray *additions_array = NULL;
@@ -66,17 +65,14 @@ ostree_builtin_commit (int argc, char **argv, const char *prefix, GError **error
   GChecksum *commit_checksum = NULL;
   char **iter;
 
+  cwd = g_get_current_dir ();
+
   context = g_option_context_new ("- Commit a new revision");
   g_option_context_add_main_entries (context, options, NULL);
 
   if (!g_option_context_parse (context, &argc, &argv, error))
     goto out;
 
-  if (repo_path == NULL)
-    repo_path = ".";
-  if (prefix == NULL)
-    prefix = ".";
-
   repo = ostree_repo_new (repo_path);
   if (!ostree_repo_check (repo, error))
     goto out;
@@ -125,7 +121,7 @@ ostree_builtin_commit (int argc, char **argv, const char *prefix, GError **error
           g_ptr_array_add (removals_array, *iter);
       
       if (!ostree_repo_commit (repo, branch, parent, subject, body, NULL,
-                               prefix, additions_array,
+                               cwd, additions_array,
                                removals_array,
                                &commit_checksum,
                                error))
@@ -149,7 +145,7 @@ ostree_builtin_commit (int argc, char **argv, const char *prefix, GError **error
           from_fd = temp_fd;
         }
       if (!ostree_repo_commit_from_filelist_fd (repo, branch, parent, subject, body, NULL,
-                                                prefix, from_fd, separator,
+                                                cwd, from_fd, separator,
                                                 &commit_checksum, error))
         {
           if (temp_fd >= 0)
@@ -163,6 +159,7 @@ ostree_builtin_commit (int argc, char **argv, const char *prefix, GError **error
   ret = TRUE;
   g_print ("%s\n", g_checksum_get_string (commit_checksum));
  out:
+  g_free (cwd);
   if (context)
     g_option_context_free (context);
   g_clear_object (&repo);
index 571eefd74282f31d728fe22e01a50dcbc319a060..a98751b96e18e2ae1c8c9640e66cba136ec3296b 100644 (file)
 
 #include <glib/gi18n.h>
 
-static char *repo_path;
-
 #define FAST_QUERYINFO "standard::name,standard::type,standard::is-symlink,standard::symlink-target,unix::*"
 
 static GOptionEntry options[] = {
-  { "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
   { NULL }
 };
 
@@ -214,7 +211,7 @@ compose_branch_on_dir (OstreeRepo *repo,
 }
 
 gboolean
-ostree_builtin_compose (int argc, char **argv, const char *prefix, GError **error)
+ostree_builtin_compose (int argc, char **argv, const char *repo_path, GError **error)
 {
   GOptionContext *context;
   gboolean ret = FALSE;
@@ -230,9 +227,6 @@ ostree_builtin_compose (int argc, char **argv, const char *prefix, GError **erro
   if (!g_option_context_parse (context, &argc, &argv, error))
     goto out;
 
-  if (repo_path == NULL)
-    repo_path = ".";
-
   repo = ostree_repo_new (repo_path);
   if (!ostree_repo_check (repo, error))
     goto out;
index 3a2175249e5df6f2c0c5abf16610a80c0082accb..7c87402fb8784bad09c974970700f06741f846fd 100644 (file)
 
 #include <glib/gi18n.h>
 
-static char *repo_path;
 static gboolean quiet;
 
 static GOptionEntry options[] = {
-  { "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", NULL },
   { "quiet", 'q', 0, G_OPTION_ARG_NONE, &quiet, "Don't display informational messages", NULL },
   { NULL }
 };
@@ -192,7 +190,7 @@ object_iter_callback (OstreeRepo  *repo,
 }
 
 gboolean
-ostree_builtin_fsck (int argc, char **argv, const char *prefix, GError **error)
+ostree_builtin_fsck (int argc, char **argv, const char *repo_path, GError **error)
 {
   GOptionContext *context;
   HtFsckData data;
@@ -205,9 +203,6 @@ ostree_builtin_fsck (int argc, char **argv, const char *prefix, GError **error)
   if (!g_option_context_parse (context, &argc, &argv, error))
     goto out;
 
-  if (repo_path == NULL)
-    repo_path = ".";
-
   data.n_objects = 0;
 
   repo = ostree_repo_new (repo_path);
index d16b57c801b35b776c8bb48df327c33170824be2..1e8580136fda424225d3bd7c11faa4efb3af23ae 100644 (file)
 
 #include <glib/gi18n.h>
 
-static char *repo_path;
 static gboolean archive;
 
 static GOptionEntry options[] = {
-  { "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", NULL },
   { "archive", 0, 0, G_OPTION_ARG_NONE, &archive, "Initialize repository as archive", NULL },
   { NULL }
 };
@@ -40,7 +38,7 @@ static GOptionEntry options[] = {
 
 
 gboolean
-ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error)
+ostree_builtin_init (int argc, char **argv, const char *repo_path, GError **error)
 {
   GOptionContext *context = NULL;
   gboolean ret = FALSE;
@@ -55,9 +53,6 @@ ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error)
   if (!g_option_context_parse (context, &argc, &argv, error))
     goto out;
 
-  if (repo_path == NULL)
-    repo_path = ".";
-
   repodir = ot_util_new_file_for_path (repo_path);
 
   child = g_file_get_child (repodir, "config");
index dddec440d09bf854ceba193f26f2520b26546e44..27edcf5cda9f099f914c83ffca0fb46b3c642967 100644 (file)
 
 #include <glib/gi18n.h>
 
-static char *repo_path;
 static gboolean ignore_exists;
 static gboolean force;
 
 static GOptionEntry options[] = {
-  { "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
   { "ignore-exists", 'n', 0, G_OPTION_ARG_NONE, &ignore_exists, "Don't error if file exists", NULL },
   { "force", 'f', 0, G_OPTION_ARG_NONE, &force, "If object exists, relink file", NULL },
   { NULL }
 };
 
 gboolean
-ostree_builtin_link_file (int argc, char **argv, const char *prefix, GError **error)
+ostree_builtin_link_file (int argc, char **argv, const char *repo_path, GError **error)
 {
   GOptionContext *context;
   gboolean ret = FALSE;
@@ -51,9 +49,6 @@ ostree_builtin_link_file (int argc, char **argv, const char *prefix, GError **er
   if (!g_option_context_parse (context, &argc, &argv, error))
     goto out;
 
-  if (repo_path == NULL)
-    repo_path = ".";
-
   repo = ostree_repo_new (repo_path);
   if (!ostree_repo_check (repo, error))
     goto out;
index c6d725b1c724729762670f01196a724879f76937..e28366cf4351d0b0abffc621e329f5624eb5a0c3 100644 (file)
 
 #include <glib/gi18n.h>
 
-static char *repo_path;
-
 static GOptionEntry options[] = {
-  { "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
   { NULL }
 };
 
 gboolean
-ostree_builtin_log (int argc, char **argv, const char *prefix, GError **error)
+ostree_builtin_log (int argc, char **argv, const char *repo_path, GError **error)
 {
   GOptionContext *context;
   gboolean ret = FALSE;
@@ -50,11 +47,6 @@ ostree_builtin_log (int argc, char **argv, const char *prefix, GError **error)
   if (!g_option_context_parse (context, &argc, &argv, error))
     goto out;
 
-  if (repo_path == NULL)
-    repo_path = ".";
-  if (prefix == NULL)
-    prefix = ".";
-
   if (argc < 2)
     {
       g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED,
index 65a52068e85fa5a5cf1e852000d8ecdce3835e35..09a1c6326fa12d5aa184b36bde579a8ede80bbe0 100644 (file)
 
 #include <libsoup/soup-gnome.h>
 
-static char *repo_path;
-
 static GOptionEntry options[] = {
-  { "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
   { NULL }
 };
 
@@ -252,7 +249,7 @@ store_commit_recurse (OstreeRepo   *repo,
 }
                       
 gboolean
-ostree_builtin_pull (int argc, char **argv, const char *prefix, GError **error)
+ostree_builtin_pull (int argc, char **argv, const char *repo_path, GError **error)
 {
   GOptionContext *context;
   gboolean ret = FALSE;
@@ -276,9 +273,6 @@ ostree_builtin_pull (int argc, char **argv, const char *prefix, GError **error)
   if (!g_option_context_parse (context, &argc, &argv, error))
     goto out;
 
-  if (repo_path == NULL)
-    repo_path = ".";
-
   repo = ostree_repo_new (repo_path);
   if (!ostree_repo_check (repo, error))
     goto out;
index 40f7c295113f320b82cfc7bacd7b6893a3a26e23..83d8adae4881a427832422d8e4e3ecc73b0b9516 100644 (file)
 
 #include <glib/gi18n.h>
 
-static char *repo_path;
-
 static GOptionEntry options[] = {
-  { "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
   { NULL }
 };
 
@@ -44,7 +41,7 @@ usage_error (GOptionContext *context, const char *message, GError **error)
 }
 
 gboolean
-ostree_builtin_remote (int argc, char **argv, const char *prefix, GError **error)
+ostree_builtin_remote (int argc, char **argv, const char *repo_path, GError **error)
 {
   GOptionContext *context;
   gboolean ret = FALSE;
@@ -59,9 +56,6 @@ ostree_builtin_remote (int argc, char **argv, const char *prefix, GError **error
   if (!g_option_context_parse (context, &argc, &argv, error))
     goto out;
 
-  if (repo_path == NULL)
-    repo_path = ".";
-
   repo = ostree_repo_new (repo_path);
   if (!ostree_repo_check (repo, error))
     goto out;
index 6e86d6cf83576645c1490d38bf1f04e5df4b8d50..9ea172dddb6c18d1f4a45f455917bdc21529633d 100644 (file)
 static char *repo_path;
 
 static GOptionEntry options[] = {
-  { "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
   { NULL }
 };
 
 gboolean
-ostree_builtin_rev_parse (int argc, char **argv, const char *prefix, GError **error)
+ostree_builtin_rev_parse (int argc, char **argv, const char *repo_path, GError **error)
 {
   GOptionContext *context;
   gboolean ret = FALSE;
@@ -50,9 +49,6 @@ ostree_builtin_rev_parse (int argc, char **argv, const char *prefix, GError **er
   if (!g_option_context_parse (context, &argc, &argv, error))
     goto out;
 
-  if (repo_path == NULL)
-    repo_path = ".";
-
   repo = ostree_repo_new (repo_path);
   if (!ostree_repo_check (repo, error))
     goto out;
index 495915640b3d6afd91efeab539a848db2679c038..9ebcee2b5b3dcf4715ced65ef141364890d55785 100644 (file)
 
 #include <glib/gi18n.h>
 
-static char *repo_path;
 static gboolean quiet;
 
 static GOptionEntry options[] = {
-  { "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
   { "quiet", 'q', 0, G_OPTION_ARG_NONE, &quiet, "Don't display informational messages", NULL },
   { NULL }
 };
 
 gboolean
-ostree_builtin_run_triggers (int argc, char **argv, const char *prefix, GError **error)
+ostree_builtin_run_triggers (int argc, char **argv, const char *repo_path, GError **error)
 {
   GOptionContext *context;
   gboolean ret = FALSE;
@@ -50,9 +48,6 @@ ostree_builtin_run_triggers (int argc, char **argv, const char *prefix, GError *
   if (!g_option_context_parse (context, &argc, &argv, error))
     goto out;
 
-  if (repo_path == NULL)
-    repo_path = ".";
-
   repo = ostree_repo_new (repo_path);
   if (!ostree_repo_check (repo, error))
     goto out;
index 8985c560972027d729915f074778066738b171c2..223fa6d05eac3a5aa1e9340322577099213aeb4a 100644 (file)
 
 #include <glib/gi18n.h>
 
-static char *repo_path;
-
 static GOptionEntry options[] = {
-  { "repo", 0, 0, G_OPTION_ARG_FILENAME, &repo_path, "Repository path", "repo" },
   { NULL }
 };
 
 gboolean
-ostree_builtin_show (int argc, char **argv, const char *prefix, GError **error)
+ostree_builtin_show (int argc, char **argv, const char *repo_path, GError **error)
 {
   GOptionContext *context;
   gboolean ret = FALSE;
@@ -51,9 +48,6 @@ ostree_builtin_show (int argc, char **argv, const char *prefix, GError **error)
   if (!g_option_context_parse (context, &argc, &argv, error))
     goto out;
 
-  if (repo_path == NULL)
-    repo_path = ".";
-
   repo = ostree_repo_new (repo_path);
   if (!ostree_repo_check (repo, error))
     goto out;
index 68e471c064e0a8e1e304e5128926650cd0587513..232d3413464d171e7f3ad55b16aa9a7a178bb2f7 100644 (file)
@@ -32,22 +32,22 @@ typedef enum {
 
 typedef struct {
   const char *name;
-  gboolean (*fn) (int argc, char **argv, const char *prefix, GError **error);
+  gboolean (*fn) (int argc, char **argv, const char *repo, GError **error);
   int flags; /* OstreeBuiltinFlags */
 } OstreeBuiltin;
 
-gboolean ostree_builtin_checkout (int argc, char **argv, const char *prefix, GError **error);
-gboolean ostree_builtin_commit (int argc, char **argv, const char *prefix, GError **error);
-gboolean ostree_builtin_compose (int argc, char **argv, const char *prefix, GError **error);
-gboolean ostree_builtin_init (int argc, char **argv, const char *prefix, GError **error);
-gboolean ostree_builtin_log (int argc, char **argv, const char *prefix, GError **error);
-gboolean ostree_builtin_link_file (int argc, char **argv, const char *prefix, GError **error);
-gboolean ostree_builtin_pull (int argc, char **argv, const char *prefix, GError **error);
-gboolean ostree_builtin_run_triggers (int argc, char **argv, const char *prefix, GError **error);
-gboolean ostree_builtin_fsck (int argc, char **argv, const char *prefix, GError **error);
-gboolean ostree_builtin_show (int argc, char **argv, const char *prefix, GError **error);
-gboolean ostree_builtin_rev_parse (int argc, char **argv, const char *prefix, GError **error);
-gboolean ostree_builtin_remote (int argc, char **argv, const char *prefix, GError **error);
+gboolean ostree_builtin_checkout (int argc, char **argv, const char *repo, GError **error);
+gboolean ostree_builtin_commit (int argc, char **argv, const char *repo, GError **error);
+gboolean ostree_builtin_compose (int argc, char **argv, const char *repo, GError **error);
+gboolean ostree_builtin_init (int argc, char **argv, const char *repo, GError **error);
+gboolean ostree_builtin_log (int argc, char **argv, const char *repo, GError **error);
+gboolean ostree_builtin_link_file (int argc, char **argv, const char *repo, GError **error);
+gboolean ostree_builtin_pull (int argc, char **argv, const char *repo, GError **error);
+gboolean ostree_builtin_run_triggers (int argc, char **argv, const char *repo, GError **error);
+gboolean ostree_builtin_fsck (int argc, char **argv, const char *repo, GError **error);
+gboolean ostree_builtin_show (int argc, char **argv, const char *repo, GError **error);
+gboolean ostree_builtin_rev_parse (int argc, char **argv, const char *repo, GError **error);
+gboolean ostree_builtin_remote (int argc, char **argv, const char *repo, GError **error);
 
 G_END_DECLS
 
index 0068b58e33afe8662f602450bd8adeff9acf482e..1c4ccc533d716b62f26c09fabc3acc26a319c9e3 100644 (file)
@@ -80,16 +80,16 @@ setup_test_repository () {
     mkdir repo
     cd repo
     ot_repo="--repo=`pwd`"
+    export OSTREE="ostree ${ot_repo}"
     cd ../files
-    export ot_repo
     if test "$mode" = "archive"; then
-       ostree init --archive $ot_repo
+       $OSTREE init --archive
     else
-       ostree init $ot_repo
+       $OSTREE init
     fi
-    ostree commit $ot_repo -b test2 -s "Test Commit 1" -m "Commit body first" --add=firstfile --add=somelink
-    ostree commit $ot_repo -b test2 -s "Test Commit 2" -m "Commit body second" --add=baz/cow  --add=baz/saucer --add=baz/deeper/ohyeah --add=baz/another/y --add=baz/alink
-    ostree fsck -q $ot_repo
+    $OSTREE commit -b test2 -s "Test Commit 1" -m "Commit body first" --add=firstfile --add=somelink
+    $OSTREE commit -b test2 -s "Test Commit 2" -m "Commit body second" --add=baz/cow  --add=baz/saucer --add=baz/deeper/ohyeah --add=baz/another/y --add=baz/alink
+    $OSTREE fsck -q
 
     cd $oldpwd
 }
@@ -99,20 +99,20 @@ setup_fake_remote_repo1() {
     mkdir ostree-srv
     cd ostree-srv
     mkdir gnomerepo
-    ostree init --archive --repo=gnomerepo
+    ostree --repo=gnomerepo init --archive
     mkdir gnomerepo-files
     cd gnomerepo-files 
     echo first > firstfile
     mkdir baz
     echo moo > baz/cow
     echo alien > baz/saucer
-    find | grep -v '^\.$' | ostree commit --repo=${test_tmpdir}/ostree-srv/gnomerepo -b main -s "A remote commit" -m "Some Commit body" --from-stdin
+    find | grep -v '^\.$' | ostree  --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "A remote commit" -m "Some Commit body" --from-stdin
     mkdir baz/deeper
-    ostree commit --repo=${test_tmpdir}/ostree-srv/gnomerepo -b main -s "Add deeper" --add=baz/deeper
+    ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "Add deeper" --add=baz/deeper
     echo hi > baz/deeper/ohyeah
     mkdir baz/another/
     echo x > baz/another/y
-    find | grep -v '^\.$' | ostree commit --repo=${test_tmpdir}/ostree-srv/gnomerepo -b main -s "The rest" --from-stdin
+    find | grep -v '^\.$' | ostree --repo=${test_tmpdir}/ostree-srv/gnomerepo commit -b main -s "The rest" --from-stdin
     cd ..
     rm -rf gnomerepo-files
     
@@ -150,6 +150,8 @@ EOF
        exit 1
     fi
     cd ${oldpwd} 
+
+    export OSTREE="ostree --repo=repo"
 }
 
 trap 'die' EXIT
index 3cd0604486ba092c3e216b962aa520b2b1c2bcb5..10c332fce035a3fa97ba33818d9f6da0c5747da4 100755 (executable)
@@ -32,12 +32,12 @@ assert_streq "$(readlink ${test_tmpdir}/repo/objects/cf/443bea5eb400bc25b376c079
 
 echo "ok check"
 
-ostree checkout $ot_repo test2 checkout-test2
+$OSTREE checkout test2 checkout-test2
 echo "ok checkout"
 
-ostree rev-parse $ot_repo test2
-ostree rev-parse $ot_repo 'test2^'
-ostree rev-parse $ot_repo 'test2^^' 2>/dev/null && (echo 1>&2 "rev-parse test2^^ unexpectedly succeeded!"; exit 1)
+$OSTREE rev-parse test2
+$OSTREE rev-parse 'test2^'
+$OSTREE rev-parse 'test2^^' 2>/dev/null && (echo 1>&2 "rev-parse test2^^ unexpectedly succeeded!"; exit 1)
 echo "ok rev-parse"
 
 cd checkout-test2
@@ -47,10 +47,10 @@ assert_file_has_content baz/cow moo
 assert_has_file baz/deeper/ohyeah
 echo "ok content"
 
-ostree commit $ot_repo -b test2 -s delete -r firstfile
+$OSTREE commit -b test2 -s delete -r firstfile
 assert_has_file firstfile  # It should still exist in this checkout
 cd $test_tmpdir
-ostree checkout $ot_repo test2 $test_tmpdir/checkout-test2-2
+$OSTREE checkout test2 $test_tmpdir/checkout-test2-2
 cd $test_tmpdir/checkout-test2-2
 assert_not_has_file firstfile
 assert_has_file baz/saucer
@@ -68,11 +68,11 @@ mkdir -p another/nested/tree
 echo anotherone > another/nested/tree/1
 echo whee2 > another/whee
 # FIXME - remove grep for .
-find | grep -v '^\.$' | ostree commit $ot_repo -b test2 -s "From find" --from-stdin
+find | grep -v '^\.$' | $OSTREE commit -b test2 -s "From find" --from-stdin
 echo "ok stdin commit"
 
 cd ${test_tmpdir}
-ostree checkout $ot_repo test2 $test_tmpdir/checkout-test2-3
+$OSTREE checkout test2 $test_tmpdir/checkout-test2-3
 cd checkout-test2-3
 assert_has_file a/nested/2
 assert_file_has_content a/nested/2 'two2'
index 39fb14f35fa18896e369314b11c4119a9d9aed1e..af97a69a0c5586d3c45c81ce81cb2ceae7c612f5 100755 (executable)
@@ -27,7 +27,7 @@ echo '1..3'
 setup_test_repository "archive"
 echo "ok setup"
 
-ostree checkout $ot_repo test2 checkout-test2
+$OSTREE checkout test2 checkout-test2
 echo "ok checkout"
 
 cd checkout-test2
index b60af4557d2cddf9785f6b1978369d8aa49b84b0..cdfa01c6d2b623f5cbc1d5fdc7a35e9e5d9a9528 100755 (executable)
@@ -25,7 +25,7 @@ set -e
 echo "1..1"
 
 setup_test_repository "regular"
-ostree log $ot_repo test2 > $test_tmpdir/log.txt
+$OSTREE log test2 > $test_tmpdir/log.txt
 assert_file_has_content $test_tmpdir/log.txt "Test Commit 1"
 assert_file_has_content $test_tmpdir/log.txt "Test Commit 2"
 echo "ok log"
index 16093d75be9d11d6add068596e6af01bab6059c9..5a974f1f216f4bf23773ca41ac05a3088058962a 100755 (executable)
@@ -25,7 +25,7 @@ set -e
 echo '1..2'
 
 setup_test_repository "regular"
-ostree remote add $ot_repo origin http://example.com/ostree/gnome
+$OSTREE remote add origin http://example.com/ostree/gnome
 echo "ok remote add"
 assert_file_has_content $test_tmpdir/repo/config "example.com"
 echo "ok config"
index a0161a44479e44a91030308e0a41ffd81996a59d..9d33b7ef7559a7fc6a1d72c2770543fd932d17c1 100755 (executable)
@@ -27,7 +27,7 @@ echo '1..1'
 setup_fake_remote_repo1
 cd ${test_tmpdir}
 mkdir repo
-ostree init --repo=repo
-ostree remote --repo=repo add origin $(cat httpd-address)/ostree/gnomerepo
-ostree pull --repo=repo origin main
+$OSTREE init
+$OSTREE remote add origin $(cat httpd-address)/ostree/gnomerepo
+$OSTREE pull origin main
 echo "ok pull"
index 88a170829b3487805eeca6a64fc0bb00378eb752..816fd8bc3ef0e664f8c4a696b59824f034c8b904 100755 (executable)
@@ -26,7 +26,7 @@ echo "1..3"
 
 setup_test_repository "regular"
 
-ostree checkout $ot_repo test2 checkout-test2
+$OSTREE checkout test2 checkout-test2
 
 cd "${test_tmpdir}"
 mkdir artifact-libfoo-runtime
@@ -36,7 +36,7 @@ echo 'an ELF file' > usr/lib/libfoo.so
 mkdir -p usr/share
 echo 'some data' > usr/share/foo.data
 
-find | grep -v '^\.$' | ostree commit $ot_repo -b artifact-libfoo-runtime -s 'Build 12345 of libfoo' --from-stdin
+find | grep -v '^\.$' | $OSTREE commit -b artifact-libfoo-runtime -s 'Build 12345 of libfoo' --from-stdin
 
 cd "${test_tmpdir}"
 mkdir artifact-libfoo-devel
@@ -46,7 +46,7 @@ echo 'a header' > usr/include/foo.h
 mkdir -p usr/share/doc
 echo 'some documentation' > usr/share/doc/foo.txt
 
-find | grep -v '^\.$' | ostree commit $ot_repo -b artifact-libfoo-devel -s 'Build 12345 of libfoo' --from-stdin
+find | grep -v '^\.$' | $OSTREE commit -b artifact-libfoo-devel -s 'Build 12345 of libfoo' --from-stdin
 
 cd "${test_tmpdir}"
 mkdir artifact-barapp
@@ -54,12 +54,12 @@ cd artifact-barapp
 mkdir -p usr/bin
 echo 'another ELF file' > usr/bin/bar
 
-find | grep -v '^\.$' | ostree commit $ot_repo -b artifact-barapp -s 'Build 42 of barapp' --from-stdin
+find | grep -v '^\.$' | $OSTREE commit -b artifact-barapp -s 'Build 42 of barapp' --from-stdin
 
 echo 'ok artifacts committed'
 
 cd "${test_tmpdir}"
-ostree compose $ot_repo some-compose artifact-libfoo-runtime artifact-libfoo-devel artifact-barapp
+$OSTREE compose some-compose artifact-libfoo-runtime artifact-libfoo-devel artifact-barapp
 echo 'ok compose command'
 
 cd some-compose